<template>
    <div class="baseWrap hovers" @click="handClick">
        <div class="baseTop">
            {{ value }}
        </div>
        <div class="label">{{ label }}</div>
    </div>
</template>
<script>
import ZSCountTo from '@/components/ZSCountTo/ZSCountTo'
export default {
    name: 'BaseItem',
    components: {
        ZSCountTo
    },
    props: {
        label: {
            type: [String, Number],
            default: () => '',
        },
        value: {
            type: [String, Number],
            default: () => 0,
        },
        portName: {
            type: [String, Number],
            default: () => 0,
        },
        loading: {
            type: Boolean,
            default: false,
        }
    },
    methods: {
        handClick() {
            return
            // 后端没添加接口先屏蔽
            if (this.label && this.portName && !this.loading) {
                let query = {
                    type: this.label,
                    port: this.portName,
                }
                this.$router.push({ path: "/work", query: query });
            }
        }
    }
}
</script>
<style lang="less" scoped>
.baseWrap {
    width: 100%;
    height: 100%;
    position: relative;

    .baseTop {
        position: absolute;
        top: 0px;
        width: calc(100% - 8px);
        margin-left: 4px;
        height: 70px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 24px;
        color: #ffffff;
        font-weight: 1000;
        // background-image: url(~@/assets/images/screen/topBox.png);
        background-image: url(~@/assets/images/ZhouShan/baseBk.png);
        background-size: 100% 100%;
    }

    .label {
        position: absolute;
        width: 100%;
        width: 100%;
        font-size: 17px;
        font-weight: 700;
        color: rgba(255, 255, 255, 1);
        text-align: center;
        bottom: 33%;
        left: 0;
        bottom: 1vh;
    }

    .baseBottom {
        width: 100%;
        height: 100%;
        background-image: url(~@/assets/images/ZhouShan/baseBk.png);
        background-size: 100% 100%;
    }
}
</style>